package com.auz.datagenerator.heuristics.value;

import com.auz.datagenerator.heuristics.value.gui.ValueHeuristicComponent;

/**
 * Abstract value heuristic class, defining a constructor taking a base value and 
 * and feedback method for step by step modification of the heuristic
 * @author Aurelien Bonnel
 */
public abstract class AbstractValueHeuristic<X> implements IValueHeuristic<X> {

	protected X base;
	protected ValueHeuristicComponent component;
	Class generic;

	/**
	 * Constructor
	 * @param _base - the base value
	 */
	public AbstractValueHeuristic(X _base) {
		generic = _base.getClass();
		base = _base;
	}
	
	public void feeback(Object _feedback) {
		if(_feedback.getClass() == generic) {
			base = (X) _feedback;
		}
	}
}
